<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<h3>Users</h3>
<c:choose>
	<c:when test="${fn:length(users) gt 0}">
		<table border=1>
			<tr>
				<th>Name</th>
				<th>Email</th>
				<th>Phone number</th>
				<th>Username</th>
				<th>Password</th>
				<th>Rol</th>
			</tr>
			<c:forEach var="user" items="${users}">
				<tr>
					<td><c:out value="${user.name}" /></td>
					<td><c:out value="${user.email}" /></td>
					<td><c:out value="${user.phoneNumber}" /></td>
					<td><c:out value="${user.username}" /></td>
					<td><c:out value="${user.password}" /></td>
					<td><c:out value="${user.role}" /></td>
				</tr>
			</c:forEach>
		</table>
	</c:when>
	<c:otherwise>No Users</c:otherwise>
</c:choose>

<p>
	<a href='<s:url  value="/admin"></s:url>'>Volver a admin</a>
</p>